import java.util.HashMap;
import java.util.Map;
//找出最多存放小球数的盒子
public class demo23 {
    public int countBalls(int lowLimit, int highLimit) {
        Map<Integer,Integer> box = new HashMap<Integer,Integer>();
        while(lowLimit<=highLimit)
        {
            int low = lowLimit;
            int sum = 0;
            while(low!=0)
            {
                sum += (low%10);
                low /= 10;
            }
            box.put(sum,box.getOrDefault(sum,0)+1);
            lowLimit++;
        }
        int ans = 0;
        for (int maxNum:box.values()) {
            ans = Math.max(ans,maxNum);
        }
        return  ans;
    }
    public static void main(String[] args) {
        Map<Integer,Integer> box = new HashMap<Integer,Integer>();

    }
}
